const express = require("express");
const http = require("http");
const app = express();
app.get('/getData', (request, response) => {
    console.log('server.', request.query);
    // 代理前端发过来的请求
    http.get(`http://localhost:3001/getData?userName=FruitJ`, res => {
        res.on('data', (chunk) => {
            response.end(chunk.toString('utf8'));
        });
    });
});
app.use(express.static(__dirname));
app.listen(3000);